<?php

namespace frontend\modules\assist\controllers;

use Yii;
use frontend\components\Controller;
use frontend\modules\assist\models\HelpSearch;

/**
 * 常见问题与帮助分类接口
 * 
 * @author emhome <emhome@163.com>
 * @since 1.0
 */
class DefaultController extends Controller {

    /**
     * {@inheritdoc}
     */
    public $modelClass = 'frontend\modules\assist\models\HelpCategorySearch';

    /**
     * {@inheritdoc}
     */
    protected function verbs() {
        return [
            '*' => ['GET'],
        ];
    }

    /**
     * 问题与帮助分类列表
     * @inheritdoc
     */
    public function actionIndex() {
        /* @var $model \frontend\modules\assist\models\HelpCategorySearch */
        $model = new $this->modelClass;
        return $model->search();
    }

    /**
     * 问题与帮助分类列表
     * @inheritdoc
     */
    public function actionView($id) {
        $model = new HelpSearch();
        $model->category_id = $id;
        return $model->search();
    }

}
